import { Command } from '@/commands/command.ts'
import { new_command } from '@/models/command.ts'

export class ShaCommand extends Command {
    public static new(args: string): Command {
        const command = new_command()
        command.args = args
        command.name = 'sha'
        command.component = 'AllowCopyCommandComponent'

        return new ShaCommand(command, false)
    }

    usage(): string {
        return 'sha [-u] [--256-224|--512-224|--512-256|--512|--512-384] 字符串'
    }

    description(): string {
        return `<div>对给定字符串进行SHA加密</div>
        <br/>
        <div>选项说明:</div>
        <br/>
        <div class="option-row"><span class="option-option">-u --upper</span><span>结果转大写</span></div>
        <div class="option-row"><span class="option-option">--256-224</span><span>使用256-224算法</span></div>
        <div class="option-row"><span class="option-option">--512-224</span><span>使用512-224算法</span></div>
        <div class="option-row"><span class="option-option">--512-256</span><span>使用512-256算法</span></div>
        <div class="option-row"><span class="option-option">--512</span><span>使用512算法</span></div>
        <div class="option-row"><span class="option-option">--512-384</span><span>使用512-384算法</span></div>`
    }
}
